home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 42 / wind14.prf < prev    next >
Text File  |  1986-07-17  |  23KB  |  438 lines

  1. .!****************************************************************************
  2. .! 
  3. .! ANTIC PUBLISHING INC., COPYRIGHT 1985.  REPRINTED BY PERMISSION.
  4. .!
  5. .! ** Professional GEM ** by Tim Oren
  6. .!
  7. .! Proff File by ST enthusiasts at
  8. .! Case Western Reserve University
  9. .! Cleveland, Ohio
  10. .! uucp : decvax!cwruecmp!bammi
  11. .! csnet: bammi@case
  12. .! arpa : bammi%case@csnet-relay
  13. .! compuserve: 71515,155
  14. .!
  15. .!****************************************************************************
  16. .!
  17. .!
  18. .!****************************************************************************
  19. .!
  20. .!            Begin Part XIV
  21. .!
  22. .!****************************************************************************
  23. .!
  24. .PART XIV USER INTERFACES - Part 2
  25. .PP
  26. This  issue of ST PRO GEM (#14) continues the  discussion  of
  27. user  interface  design which began in episode eight.   It  begins
  28. where  we left off,  with a further treatment of the mode problem,
  29. and  proceeds  into  topics such as visual  grammar  and  layered
  30. interfaces.
  31. .PP
  32.      Note  that  there  is  no  download  for  this  column.   The
  33. downloads  will return with the next issue,  a discussion of using
  34. the  GEM DOS file system within a GEM application.   Specifically,
  35. it  will include sample code for using the file selector,  the GEM
  36. form_error  alerts,  and some utilities for manipulating file  and
  37. path names.  There will also be a feedback section.  The following
  38. two columns will be devoted to "graphics potpourri",  a collection
  39. of  small  but useful GEM utilities such as  popup  menus,  string
  40. editing, and source code for drag and rubber box operations.
  41. .SH MODES AGAIN
  42. If a program is modeless, it acts predictably,
  43. which turns out to be very important.   On the other hand,  a good
  44. definition  for  "modes"  is hard to find.   In  column  eight,  I
  45. suggested  that  a  mode exists when you cannot  use  all  of  the
  46. capabilities  of the program without performing some  intermediate
  47. step.   If  this  is  less  than clear,  here  are  two  alternate
  48. definitions offering different views of the problem.
  49. .SH THE "TWO USER TEST"
  50. Consider  the  following  thought
  51. experiment:   Imagine  that  your ST (and GEM) had two  mice,  two
  52. cursors,  and  two  users.   Could  they both effectively use  the
  53. program at the same time?  If so, the application is modeless.  If
  54. there are points where one user can be "locked out" by the actions
  55. of  the other,  then a mode exists at that point.  Let's  consider
  56. some examples of this test.
  57. .PP
  58. In any program which uses the GEM menu system, one user could
  59. stop  the  other by touching a menu hotspot and dropping  a  menu.
  60. This constitutes an inherent mode in the GEM architecture.
  61. .PP
  62. On  the  GEM Desktop,  two users could open windows and  view
  63. files without interference.   However, as soon as one person tries
  64. to delete a file (assuming the verify option is on),  the other is
  65. brought  to  a halt as a dialog appears.   Thus,  we have found  a
  66. modal dialog.
  67. .PP
  68. In  many "Paint-type" programs,  such as MacPaint,  PC Paint,
  69. and  GEM Paint,  two artists could co-exist quite well,  utilizing
  70. the  on-screen  palette  and tool  selection.   Of  course,  these
  71. programs  also contain modal dialogs for such operations  as  file
  72. and  brush  shape  selection.   In contrast,  consider  the  paint
  73. program  DEGAS  for  the ST.   Here,  two artists could only  work
  74. together as long as neither wanted to change tool or color.   Then
  75. the  display  would have to be flipped to  the  selection  screen,
  76. stopping the other user.  This is a mode in the DEGAS interface.
  77. .PP
  78. (By the way, this test is not just academic.  The grand-daddy
  79. of all mouse based systems, NLS, demonstrated by Doug Englebart in
  80. 1968,  had  two  mice  and two users,  one of whom was  physically
  81. remote.   Cooperative  techniques  such as this are still  largely
  82. unexplored and unexploited.)
  83. .SH ONE LINER
  84. Here's  a  terse definition by  Jef  Raskin:  A
  85. program is modeless if a given action has one and only one result.
  86. Again, let's run a few examples.
  87. .PP
  88. The  menu  dropdowns are clearly modal  by  this  definition.
  89. Before  the  menu was activated,  window control points  could  be
  90. activated with a click.   However, when the dropdown is visible, a
  91. click action is interpreted as a menu selection or a dismissal  of
  92. the dropdown.   Similarly, dialogs are modal because the action of
  93. moving  the mouse into the menu bar no longer causes the  dropdown
  94. to appear.
  95. .PP
  96. I am typing this using the First Word editor program.  It has
  97. a  nice desktop level box full of characters where I can click  to
  98. get  symbols which the ST keyboard won't produce.   However,  if I
  99. invoke  the  find or replace string dialog,  the  click-in-the-box
  100. action  doesn't  work anymore.   This is a mode in the First  Word
  101. interface.
  102. .PP
  103. Finally, consider an "old style" menu program, the kind where
  104. you  type in the number of the desired action from a list.   Since
  105. the  number  "2" might mean "Insert the record" in one  menu,  and
  106. "Purge  the file" in another,  such a program is clearly modal  by
  107. Raskin's definition.
  108. .PP
  109. These  three definitions say almost the same thing,  but from
  110. different  viewpoints.   Depending  on the situation,  one or  the
  111. other  may  be more intuitive for you.   The goal of this type  of
  112. analysis  is to root out unnecessary modes,  and to make sure that
  113. those  which remain only appear when requested by the user,  offer
  114. some visual cue such as a rubber line or standard dialog box,  and
  115. are used consistently throughout the application.
  116. .SH PREDICTABILITY FOREVER AND EVER AND EVER
  117. As  Raskin's
  118. definition  makes  clear,  when the modes go away,  the  interface
  119. becomes  predictable.   Predictability  leads to the formation  of
  120. habits   of   use.     Habits  reduce  "think  time"  and   become
  121. progressively faster due to the Power Law of Practice discussed in
  122. column eight.  This is exactly what we want!
  123. .PP
  124. There is another benefit of predictability.   A habit learned
  125. in  one  part  of a program with a  consistent  interface  can  be
  126. transferred  and  used elsewhere in the application.   If  several
  127. programs share the same style of interface, the same habits can be
  128. used across a complete set of products.  Learning time for the new
  129. functions becomes shorter,  and the user is more likely to use the
  130. new feature.
  131. .SH IS A BOGEYMAN!
  132. Most  casual  users are  scared  silly  of
  133. computers  and programs.   (If you have any doubt,  eavesdrop on a
  134. secretary with a new word processor,  or the doctor's receptionist
  135. coping with an insurance data entry program.)  In most cases, they
  136. have  a  right to be frightened.   Even  experienced  programmers,
  137. prone  to  toss  the manuals and hack  away,  know  that  moderate
  138. paranoia  is  the best way to deal with an unknown  program.   How
  139. must this feel to someone whose ability to perform (or lose) their
  140. job depends on an unpredictable (aha!) black box.
  141. .PP
  142. So here's another way in which predictability works.   But to
  143. produce  a truly fearless user,  we need other qualities as  well.
  144. One  is robustness,  meaning that the program will not crash given
  145. normal or even bizarre actions by the user.   Another is feedback,
  146. which shuts off invalid options,  reinforces correct actions,  and
  147. gives  reassurance  that  an  operation  is  proceeding  normally.
  148. Finally, we need forgiveness, in the form of inverse operations or
  149. Undo options, when the inevitable mistake is made.
  150. .PP
  151. The  ultimate  goal is make the program  discoverable.   This
  152. means  the user should be able to safely "wing it" after  a  short
  153. session  with  the application and its interface.   This  practice
  154. ought to be considered the norm anyway, since the manual is always
  155. across  the office or missing when an esoteric and  half-forgotten
  156. feature  is  needed.   If it is possible to muddle through such  a
  157. situation  by  trial  and  error,   without  causing  damage,  the
  158. immediate  problem  will  be  solved,   and  the  user  will  gain
  159. confidence.
  160. .SH GOOD GRAMMAR OR...
  161. So exactly what are these habits that are
  162. supposed  to be so helpful?   One of the most useful patterns is a
  163. consistent  command  grammar  for the  program.   This  may  sound
  164. strange,   since   we  have  supposedly  abandoned  command   line
  165. interfaces  in the graphics world,  but in fact,  the same type of
  166. rules apply.   For instance, in the world of A> we might issue the
  167. command:
  168. .br
  169. .sp
  170. .ce
  171. copy a:foobar.txt b:
  172. .PP
  173. By  analogy  to  Englist grammar,  this command contains  a  verb,
  174. "copy",  a  file  as  subject:  "a:foobar.txt",  and a location as
  175. an object: "b:".  The equivalent GEM Desktop operation is:
  176. .BO
  177. - Move mouse to foobar.txt icon in a: window
  178. .EO
  179. .BO
  180. - Press mouse button
  181. .EO
  182. .BO
  183. - Move mouse to b: icon
  184. .EO
  185. .BO
  186. - Release mouse button
  187. .EO
  188. .PP
  189. The  operation  can be described as a  select-drag-drop  sequence,
  190. with  the select designating the subject file,  the drag  denoting
  191. the  operation  (copy),  and the location of the drop showing  the
  192. object.   A  grammar still exists,  but its "terminal symbols" are
  193. composed  of  mouse  actions interpreted in  the  context  of  the
  194. current screen display, rather than typed characters.
  195. .PP
  196. One  useful way to analyze simple grammars,  including  those
  197. used  as  command  languages,  is to separate  them  into  prefix,
  198. postfix,  and infix forms.   In a prefix grammer, the operation to
  199. be  performed precedes its operands,  that is,  its subject(s) and
  200. object(s).   The  DOS copy command given above is an example of  a
  201. prefix  command.   LISP  is  an example of a language  which  uses
  202. prefix specification for its commands.
  203. .PP
  204. Postfix grammars specify the action after all of the operands
  205. have been given.   This command pattern is familiar to many as the
  206. way  in  which  Hewlett-Packard calculators  work.   FORTH  is  an
  207. example of a language which uses a postfix grammar.
  208. .PP
  209. Infix  notation  places the verb,  or operator,  between  its
  210. subject and object.   Conventional algebraic notation is infix, as
  211. are most computer languages such as C or PASCAL.   The example GEM
  212. command  given  above  is also infix,  since the  selection  of  a
  213. subject  file  preceded  the action,  which was  followed  by  the
  214. designation of an object.
  215. .PP
  216. The  "standard" GEM command grammar,  as used in the products
  217. produced  by Digital Research,  is in fact infix.   This is not to
  218. say that GEM enforces such a convention,  or that it is rigorously
  219. followed.  However, when there is no pressing reason for a change,
  220. adoption  of an infix command grammar will make  your  application
  221. feel most like others which users may have seen.
  222. .PP
  223. The general problem of specifying a graphic command  language
  224. can be difficult, but much of the problem has already been handled
  225. on the ST.   Part of the solution is by constraint:  the input and
  226. output hardware of the ST are predefined,  so most developers will
  227. not  need  to  worry about choosing a pointing  device  or  screen
  228. resolution.   The  other part of the standard solution is the  GEM
  229. convention for mouse usage.  I am going to review these rules, and
  230. then describe of the situations in which they have been bent,  and
  231. finally  some alternate approaches which may prove useful to  some
  232. developers.
  233. .SH SPECIFYING A SUBJECT
  234. There are really two sets of methods
  235. for  designating what is to be affected by an operation.   One set
  236. is  used when distinct objects are to be affected.   Examples  are
  237. file and disk icons in the Desktop and trees in the RCS.   Another
  238. set of designation methods is used when continuous material,  such
  239. as text or bit images, is being handled.
  240. .PP
  241. When dealing with objects, a single mouse click (down and up)
  242. over the object selects it.   The application should show that the
  243. selection  has occurred by changing the appearance of the  object.
  244. The  most  common  methods are inverting the  object,  or  drawing
  245. "handles" around it.
  246. .PP
  247. Many   operations   allow  "plural",   or  multiple   object,
  248. selections.  The GEM convention is that a click on an object while
  249. the  shift key is held down extends the selection by  adding  that
  250. object.   If the shift-clicked object was already selected,  it is
  251. deleted from the selection list.
  252. .PP
  253. Another  way to select multiple objects is to use  a  "rubber
  254. box"  to enclose them.   This operation begins with drag on a part
  255. of  the  view where no object is present.   The  application  then
  256. animates a rubber box on the screen as long as the mouse button is
  257. held  down.   When the button is released,  all objects within the
  258. current extent of the box are selected.   A shift-drag combination
  259. could be used to add the objects to an existing selection list.
  260. .PP
  261. Selecting  part of a text or bit plane display is  also  done
  262. with a rubber box.   Since there are no "objects" in the view, any
  263. mouse  drag  is  interpreted  as  the  beginning  of  a  selection
  264. operation.   In  the  simplest  case,  a bit plane,  the rectangle
  265. within the box when the button is released is the selected extent.
  266. .PP
  267. When  the  underlying data has structure,  such as words  and
  268. lines  of  text,  the display should reflect this fact during  the
  269. selection  operation.   Typically,  text selection is indicated by
  270. inversion  of  the  characters  rather than  a  rubber  box.   The
  271. selection  extends  along the starting line so long as  the  mouse
  272. stays  within the line.   If the mouse move off the starting  text
  273. line, the implied selection is all characters between the starting
  274. character  and the character currently under the mouse,  which  is
  275. not necessarily a rectangular area.
  276. .PP
  277. An  extended  "plural"  selection may be  supported  in  text
  278. editing.   The  use of the shift key is also conventional in  this
  279. application.
  280. .SH ACTION
  281. With the subject designated, the user can now choose
  282. an operation.   In many cases,  this will be picked from the menu,
  283. in  which  case  the  entire  command  is  complete.    Some  menu
  284. selections will lead to dialogs,  in which the interaction methods
  285. are  regulated  by  the GEM form manager.   When  the  command  is
  286. completed,  it  is  often  helpful if the application  leaves  the
  287. objects  (or areas) selected and ready for another  operation.   A
  288. single click away from any object is interpreted as cancelling the
  289. selections.
  290. .PP
  291. Many  operations  are indicated by gestures  on  the  screen.
  292. Usually,   this  is  some  variant  of  a  drag  operation.    The
  293. interpretation of the gesture may depend on the type and  location
  294. of the selected subject,  which part of it is under the mouse, and
  295. in what location the drag terminates.
  296. .PP
  297. "Handles"  are small boxes or dot displayed around an  object
  298. when it is selected.   A drag beginning with the mouse on a handle
  299. is  usually  interpreted  as  a resizing  operation,  if  this  is
  300. appropriate.   The  pointing  finger  mouse form is  displayed  to
  301. indicate  the operation in progress,  and a rubber version of  the
  302. object  is animated on the screen to show the user the  result  if
  303. the  button  were released.   In some cases,  where an  underlying
  304. "snap"  grid  exists,  the  animated  object may  change  size  in
  305. discrete steps.
  306. .PP
  307. Dragging  a non-handle area of a selected object  is  usually
  308. interpreted  as  the  beginning  of  a  move  function.   In  most
  309. applications,  a  move  of a single object may be started  without
  310. pre-selection.   Simply  beginning the drag on the object is taken
  311. to imply selection.  The spread hand, or "grabber", mouse form  is
  312. typically displayed during a drag operation.
  313. .PP
  314. Dragging  may  denote copying or movement,  or  more  complex
  315. functions such as instantiation or generalization.   The operation
  316. implied by movement on the screen will differ among  applications,
  317. and  often  within  the  same  application,  depending  on  target
  318. location.   This  target is the recipient of the command's action,
  319. or its object, in an English grammar sense.
  320. .PP
  321. For  example,  a  drag from window to window in  the  Desktop
  322. denotes a copy.   On the other hand, dragging the same icon to the
  323. trashcan  deletes it completely.   Dragging an object from the RCS
  324. partbox  to the editing view creates a new copy of that  prototype
  325. object.   Dragging  the  same object within the edit  view  simply
  326. changes its placement.
  327. .PP
  328. There   are  some  mouse  actions  which   are   conventional
  329. "abbreviations".   A  double click on an object is interpreted  as
  330. both a selection and an action.   Usually, the double click action
  331. is the same as the Open entry in the "File" menu.
  332. .PP
  333. When  the  usual interpretation of a drag is  movement,  then
  334. shift-drag  may be used as an enhanced varient  implying  copying.
  335. For  instance,  shift-dragging  an object within the  RCS  editing
  336. window  makes  a  copy of the object and places it  in  the  final
  337. location.
  338. .PP
  339. To return to the beginning of this discussion, the reason for
  340. adopting  these conventional usages is to build an interface  that
  341. promotes  habits.   Particularly,  a  standard grammar for  giving
  342. commands helps answer the question "What comes next?".   It breaks
  343. the user's actions into logical phrases,  or chunks,  which may be
  344. thought of a whole, rather than one action at a time.
  345. .SH DIFFERENT FOLKS, DIFFERENT STROKES
  346. .PP
  347. There  are  always
  348. exceptions to a rule,  or so it seems.   In this case, consistency
  349. of   the  interface  grammar  is  sometimes  traded  off   against
  350. consistency of metaphor,  preservation of screen space,  and "fast
  351. path" methods for experts.
  352. .PP
  353. One example is the use of "tools" in Paint and Draw programs.
  354. In  such  programs,  an  initial  click is made on  a  tool  icon,
  355. denoting the operation to be applied to all following  selections.
  356. This is an prefix style of grammar,  and stands in contrast to the
  357. usual  method  of selecting subject object(s) first.   Because  of
  358. this contrast,  it is sometimes called "moding the cursor".   (Try
  359. applying the tests above to be sure it really is a mode.)
  360. .PP
  361. In  these  cases,  there  are two reasons for  accepting  the
  362. nonstandard  method.   The first is consistency of metaphor.   The
  363. "user model" portrayed in the programs is an artist's work  table,
  364. with  tools,  palette,  and  so  on.   The cursor moding action is
  365. equivalent  to  picking up a working tool.   The second reason  is
  366. speed.   In a Paint program,  the "canvas" is often modified,  and
  367. speed  in  creating or changing the bits is  important.   In  more
  368. object  oriented applications such as Desktop or RCS,  the objects
  369. are more persistent.   Speed is then more essential when adding or
  370. changing properties of the objects.
  371. .PP
  372. When  command  styles  are mixed in this  fashion,  you  must
  373. design very carefully to avoid conflicts or apparent  side-effects
  374. in  the  command language.   For example,  in GEM Draw picking  an
  375. action from the Edit menu cancels the current cursor mode  without
  376. warning.   Confusion  from  such side-effects may cancel  out  the
  377. benefits of the mixed grammar.
  378. .PP
  379. The  subject  of command speed  deserves  further  attention.
  380. While  the  novice approaching a program needs  full  feedback,  a
  381. person who uses it day in and day out will learn the program,  and
  382. want  faster  ways  to get the job done,  even if  they  are  more
  383. arcane.  The gives rise to a "layered" style of interface.
  384. .PP
  385. A layered interface is designed so that the visual grammar is
  386. obvious,  as  we  have discussed.   However, there are one or more
  387. sets of "accelerators" built into the program, which may be harder
  388. to find but faster to use.  One example is condensed mouse actions
  389. such  as the double-click.   For instance,  attempting to select a
  390. block  of text which extends beyond a window is  impossible  using
  391. the  basic metaphor.   The novice will simply do the operation  in
  392. pieces.   A  layered interface might put a less obvious Mark Begin
  393. and  Mark End option in the menus.   Another way is to take a drag
  394. which  extends outside the window as a request to begin  scrolling
  395. in that direction, while extending the current selection.
  396. .PP
  397. One  of  the most common and useful  accelerator  methods  is
  398. function  keys.   Using  this approach,  single key equivalents to
  399. actions are listed in the menu.   Striking this key when an object
  400. is  selected  will cause the action to occur.   Note that this  is
  401. most  useful if some keyboard driven method of  object  selection,
  402. such as tabbing, is also available.  Otherwise, the time switching
  403. from  the  mouse,  used to select the object,  to the keyboard for
  404. command input, may well cancel any advantage.
  405. .PP
  406. Finally,  radical  departures  from the GEM metaphor  may  be
  407. useful when attempting to replicate the look of another system, or
  408. trying  to  meet severe constraints,  such as display space.   One
  409. example  would  be discarding the standard GEM menus in  favor  of
  410. "popup"  menus which appear next to the current mouse position  in
  411. response  to  a click on the second button.   This method has  the
  412. advantage  of preserving the menu space at the top of the  screen,
  413. and  is potentially faster because the menu appears right next  to
  414. the  current mouse position.   The drawbacks are lack of a  visual
  415. cue for naive users trying to find the commands,  and the need for
  416. custom coding to build the popups.
  417. .SH MORE TO COME
  418. We have reached the end of the second sermon
  419. on  user  interface.   In a future column,  I will look at "higher
  420. level"  topics  relating to the design of the  application's  user
  421. metaphor.   These  include  issues of object  orientation,  direct
  422. manipulation,   and  the  construction  of  microworlds.   In  the
  423. meantime,  several  of  the  more practical columns  will  present
  424. implementions  of  techniques such as accelarator keys  and  popup
  425. menus which I have discussed this time.
  426. .PP
  427. THANKS AND APOLOGIES to the following people whose public and
  428. published   remarks  have  formed  part  of  the  basis  of   this
  429. discussion:  Jef Raskin, Bill Buxton, Adele Goldberg, James Foley,
  430. and Ben Schneidermann.  As always, any errors are my own.
  431. .!
  432. .!
  433. .!*****************************************************************************
  434. .!*                                          *
  435. .!*                End Part XIV                      *
  436. .!*                                          *
  437. .!*****************************************************************************
  438.